<div class="container">
    <div class="white_box">
        <div class="box-body">
            <div class="row">
                <div class="col-sm-4">
                    <div class="row row-sm">
                        <div class="col-xs-6 col-sm-6 row_no_pad_right">
                            <a class="btn btn-danger btn-sm btn-block" href="<?php echo $w_url; ?>"><i
                                    class="fa fa-arrow-left"></i>
                                返回查看<span
                                    class="hidden-xs hidden-sm">壁纸详情</span></a>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 text-center-desk">
                    下载壁纸
                    - <?php echo ucwords($type); ?>
                </div>
                <div class="col-sm-4 m_t_10">
                    <?php if ($colors) { ?>
                        <div class="wallpaper_colors text-right-no-xs">
                            <?php foreach ($colors as $i => $color_data) { ?>
                                <?php if ($i >= 16) break; ?>
                                <a href="<?php echo $this->route_links->build_link('search_page') . '?color=' . $color_data->hex_code; ?>">
                            <span data-toggle="tooltip" data-placement="bottom"
                                  data-original-title="<?php echo round($color_data->count * 100, 2); ?>%"
                                  title="<?php echo round($color_data->count * 100, 2); ?>%"
                                  style="background: #<?php echo $color_data->hex_code; ?>" class="color_block"></span>
                                </a>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-3">
            <?php if (isset($previous_next['previous'])) { ?>
                <?php $search_replace = array(
                    '{C_SLUG_FULL}' => $previous_next['previous']->cFullSlug,
                    '{C_SLUG}' => $previous_next['previous']->category_slug,
                    '{W_SLUG}' => $previous_next['previous']->wallpaper_slug,
                    '{W_HASH}' => $previous_next['previous']->wallpaper_hash,
                ); ?>
                <a data-toggle="tooltip" data-placement="bottom"
                   title="上一张: <?php echo $previous_next['previous']->wallpaper_name; ?>"
                   href="<?php echo $this->route_links->build_link($slug, $search_replace); ?>"><i
                        class="fa fa-backward"></i></a>
            <?php } ?>
        </div>
        <div class="col-sm-6 text-center">
            <?php if ($type == 'facebook') { ?>
                <button class="btn btn-primary upload_cover"><i
                        class="fa fa-facebook"></i> <?= $this->language->get_text('facebook---set-as-cover-picture', 'wallpaper') ?>
                </button>
                <span class="approve_link hide">
                    <a class="btn btn-default" target="_blank"
                       href=""><?= $this->language->get_text('click-here-to-approve-cover', 'wallpaper') ?></a>
                </span>
            <?php } ?>
        </div>
        <div class="col-sm-3">
            <?php if (isset($previous_next['next'])) { ?>
                <?php $search_replace = array(
                    '{C_SLUG_FULL}' => $previous_next['next']->cFullSlug,
                    '{C_SLUG}' => $previous_next['next']->category_slug,
                    '{W_SLUG}' => $previous_next['next']->wallpaper_slug,
                    '{W_HASH}' => $previous_next['next']->wallpaper_hash,
                ); ?>
                <div class="text-right">
                    <a data-toggle="tooltip" data-placement="bottom"
                       title="下一张: <?php echo $previous_next['next']->wallpaper_name; ?>"
                       href="<?php echo $this->route_links->build_link($slug, $search_replace); ?>"><i
                            class="fa fa-forward"></i></a>
                </div>
            <?php } ?>
        </div>
    </div>
    <div class="clearfix"></div>
</div>

<div class="cover_s_data m_t_10">
    <?php $request_width = IMAGE_WIDTH_THUMB;
    $request_height = 0; ?>
    <img class="crop_image_target thumbnail img-center m_t_10" data-width="<?php echo $width; ?>"
         data-height="<?php echo $height; ?>"
         style="width:<?php echo $request_width; ?>px;; height:auto; display:block; min-width:<?php echo $request_width; ?>px;"
         src="http://img.jindan8.com/<?php echo $this->image_workshop->crop_image(ORIGINALS_FOLDER_WF . '/' . $wallpaper->wallpaper_image_path, $request_width, $request_height, $wallpaper->wallpaper_crop_position, 'thumbnail'); ?>"
         alt="<?php echo $wallpaper->wallpaper_name; ?>">
    <input type="hidden" id="x" name="x"/>
    <input type="hidden" id="y" name="y"/>
    <input type="hidden" id="w" name="w"/>
    <input type="hidden" id="h" name="h"/>
    <input type="hidden" name="w_hash" value="<?php echo $wallpaper->wallpaper_hash; ?>"/>
    <input type="hidden" name="type" value="<?php echo $type; ?>"/>
</div>